<!DOCTYPE html>
<html xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<link href="resources/styles/main.css" rel="stylesheet" type="text/css" />
</h:head>

<f:event type="preRenderView" listener="#{personViewBean.init}" />

<h:body>
	<p:ajaxStatus onstart="statusDialog.show();"
		onsuccess="statusDialog.hide();" />
	<p:dialog modal="true" widgetVar="statusDialog" header="#{msg.loading}"
		draggable="false" closable="false">
		<p:graphicImage value="/resources/img/ajaxloadingbar.gif" />
	</p:dialog>
	<f:view locale="#{language.localeCode}" />
	<div id="container">
		<div id="header">
			<ui:include src="/query.xhtml">
				<ui:param name="title" value="#{msg.person}" />
				<ui:param name="bean" value="#{personViewBean}" />
			</ui:include>
		</div>
		<div id="content">
			<h:form id="personform">

				<p:dataTable var="rec" rowKey="#{rec.id}" paginator="true" rows="5"
					value="#{personViewBean.persons}"
					selection="#{personViewBean.selectedPerson}" id="personTable"
					rowsPerPageTemplate="5,10,15,25,50,100"
					emptyMessage="#{msg.norecordsfound}">

					<f:facet name="header">  
            #{msg.lperson} (#{personViewBean.length}) 
        </f:facet>
        <p:ajax event="sort"
                            listener="#{personViewBean.caseListSortListner}" update=":personform:personTable" />
					<p:column selectionMode="single" style="width:18px" />
					<p:ajax event="rowSelect"
						listener="#{personViewBean.onRowSelect}"
						update=":personform" />
					<p:column headerText="ID" sortBy="#{rec.id}" filterBy="#{rec.id}"
						id="id">  
            #{rec.id}  
        </p:column>
					<p:column headerText="FirstNameUa" sortBy="#{rec.firstnameua}"
						filterBy="#{rec.firstnameua}" id="firstnameua">  
            #{rec.firstnameua}  
        </p:column>
					<p:column headerText="LastNameUa" sortBy="#{rec.lastnameua}"
						filterBy="#{rec.lastnameua}" id="lastnameua">  
            #{rec.lastnameua}  
        </p:column>
					<p:column headerText="MiddleNameUa" sortBy="#{rec.middlenameua}"
						filterBy="#{rec.middlenameua}" id="middlenameua">  
            #{rec.middlenameua}  
        </p:column>
					<!-- <p:column headerText="FirstNameRu" sortBy="#{rec.firstnameru}"
						filterBy="#{rec.firstnameru}" id="firstnameru">  
            #{rec.firstnameru}  
        </p:column>
					<p:column headerText="LastNameRu" sortBy="#{rec.lastnameru}"
						filterBy="#{rec.lastnameru}" id="lastnameru">  
            #{rec.lastnameru}  
        </p:column>
					<p:column headerText="MiddleNameRu" sortBy="#{rec.middlenameru}"
						filterBy="#{rec.middlenameru}" id="middlenameru">  
            #{rec.middlenameru}  
        </p:column>
					<p:column headerText="FirstNameEng" sortBy="#{rec.firstnameeng}"
						filterBy="#{rec.firstnameeng}" id="firstnameeng">  
            #{rec.firstnameeng}  
        </p:column>
					<p:column headerText="LastNameEng" sortBy="#{rec.lastnameeng}"
						filterBy="#{rec.lastnameeng}" id="lastnameeng">  
            #{rec.lastnameeng}  
        </p:column> -->
        			<p:column headerText="Dob" sortBy="#{rec.dob}"
						filterBy="#{rec.dob}" id="dob">  
            #{rec.dob}  
        </p:column>
        			<p:column headerText="Address" sortBy="#{rec.address}"
						filterBy="#{rec.address}" id="address">  
            #{rec.address}  
        </p:column>
        			<p:column headerText="Details" sortBy="#{rec.details}"
						filterBy="#{rec.details}" id="details">  
            #{rec.details}  
        </p:column>
        			<!-- <p:column headerText="Sex" sortBy="#{rec.sex}"
						filterBy="#{rec.sex}" id="sex">  
            #{rec.sex}  
        </p:column>
        			<p:column headerText="Phone" sortBy="#{rec.phone}"
						filterBy="#{rec.phone}" id="phone">  
            #{rec.phone}  
        </p:column>
        			<p:column headerText="Email" sortBy="#{rec.email}"
						filterBy="#{rec.email}" id="email">  
            #{rec.email}  
        </p:column> -->
        			<p:column headerText="Code" sortBy="#{rec.code}"
						filterBy="#{rec.code}" id="code">  
            #{rec.code}  
        </p:column>
        			<!-- <p:column headerText="Modified" sortBy="#{rec.modified}"
						filterBy="#{rec.modified}" id="modified">  
            #{rec.modified}  
        </p:column>
        		<p:column headerText="Created" sortBy="#{rec.created}"
						filterBy="#{rec.created}" id="created">  
            #{rec.created}  
        </p:column> -->
				</p:dataTable>
			</h:form>

		</div>
		<div id="footer">
			<ui:include src="/footer.xhtml" />
		</div>
	</div>
</h:body>
</html>